import QtQuick 2.2
import "../mainmenu"

Rectangle {
    width: 800; height: 50
    signal onselect(int flag, string content)

    Row{
        MainmenuItem{id: addInstruct; width: 794/5; content: qsTr("  添加指令 ▲"); flag: 1; color: qsTr("#C0C0C0");
            onSelectItem: {
                console.log(qsTr("send message to Programming UI -------------ProOrder"));
                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())
                if(edit.flag === 0)
                    edit.changeState()
                if(debug.flag === 0)
                    debug.changeState()
                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())
                onselect(flag, text);
            }
        }
        MainmenuItem{id: edit; width: 794/5; content: qsTr("  编辑 ▲"); flag: 1; color: qsTr("#C0C0C0");
            onSelectItem: {
                console.log(qsTr("send message to Programming UI -------------ProOrder"));
                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())
                if(addInstruct.flag === 0)
                    addInstruct.changeState()
                if(debug.flag === 0)
                    debug.changeState()
                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())

                onselect(flag, text);
            }
        }
        MainmenuItem{id: debug; width: 794/5; content: qsTr("  调试 ▲"); flag: 1; color: qsTr("#C0C0C0")
            onSelectItem: {
                console.log(qsTr("send message to Programming UI -------------ProOrder"));
                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())

                if(addInstruct.flag === 0)
                    addInstruct.changeState()
                if(edit.flag === 0)
                    edit.changeState()

                console.log("addInstruction.flag "+addInstruct.flag.toString())
                console.log("edit.flag "+edit.flag.toString())
                console.log("debug.flag "+debug.flag.toString())
                onselect(flag, text);
            }
        }
        MainmenuItem{width: 794/5; content: qsTr("  修改位置");flag: 1; color: qsTr("#C0C0C0")/*; enabled: false*/}
        MainmenuItem{
            width: 794/5; content: qsTr("  显示声明"); flag: 1; color: qsTr("#C0C0C0")
            onSelectItem:{
                if(text == "  显示声明")
                {
                    isclick = true
                    content = qsTr("  隐藏声明")
                }
                else
                {
                    isclick = false
                    content = qsTr("  显示声明")
                }
            }
        }
    }
}
